Get Attribute Unit List
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/attribute/unit/list
Query parameters
Parameter | Type | Description |
---|---|---|
type | string | Required. Attribute unit types, including visible and all. |
keyword | string | Fuzzy match the name and alias. |
Response
- 200: Successful.
{
"code" : 200,
"data" : [ {
"id" : 16667,
"name" : "km"
} ],
"detail" : "string",
"message" : "ok"
}
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Get Attributes by Search Conditions
Comprehensive attribute query interface, and you can use it to run complex filters on attributes. For example: Get attributes under instance i1, bound with the label system.label2, not belong to the app test and return attribute values.
instanceNames=i1&labelFullNames=system.label2&
excludeAppNames=true&appNames=test&needValue=true
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/attributes
Query parameters
Parameter | Type | Description |
---|---|---|
hasBindRelation | boolean | Whether the attributes are bound with others. |
withBindRelation | boolean | Whether the returned data is bound with others. |
historical | boolean | Whether there is historical data. |
displayable | boolean | Whether to display main field. |
needValue | boolean | Whether to return attribute values. Used together with instanceNames, and when the returned attribute is inherited by multiple instances, corresponding value is the attribute value of the last instance from the instanceNames list. |
needInstanceInfo | boolean | Whether to return instance name and alias. Used together with instanceNames, and when there are multiple instances, information of the last instance from the instanceNames list will be returned. |
excludeLabelFullNames | boolean | Whether to get data without specific labels. Used together with labelFullNames. |
excludeAppNames | boolean | Whether to get data that is not under specified app. Used together with appNames. |
containsInheritedMetadata | boolean | Whether to contain inherited metadata. Used together with specific template or instance. |
containsSelfMetadata | boolean | Whether to contain metadata. Used together with specific template or instance. |
needKnowAlarm | boolean | Whether to get alarm status. If it is true, the returned field existAlarm is valid. |
dataTypes | array | - |
filterNames | array | Filtering attribute aliases. |
filterNamespace | string | Filtering namespaces. |
keyword | string | Fuzzy match the name and alias. |
pageIndex | integer | Required. Page number. The default is 1. |
pageSize | integer | Required. The number of data on each page. The default is 20 and the maximum is 500. |
namespaces | array | - |
labelFullNames | array | Label namespace. |
appNames | array | - |
instanceNames | array | Instance alias list that contains the metadata. When it is not empty, templateNames is invalid. |
sourceFunctionSetFullNames | array | Source function set namespace. |
templateFullNames | array | Template namespace that contains the metadata. |
functionSetFullNames | array | Function set namespace that contains the metadata. |
Response
- 200: Successful.
{
"list" : [ {
"comment" : "this ia s test",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system",
"existAlarm" : false, //no existing alarms
"value" : "string", //attribute value
"instanceEnName" : "string",
"instanceDisplayName" : "string"
} ],
"pagination" : [ {
"total" : 10, //total data
"pageSize" : 20,
"current" : 1 //current page number
} ]
}
- 400: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Get Attribute Details by Attribute Namespace and Alias
Get specified attributes and returns nothing when there is no required results. The results can be at most 100.
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/instance/attributes
Query parameters
instanceAttributes: Instance attribute alias. In the format of attribute namespace.attribute alias.
Response
- 200: Successful.
[ {
"comment" : "this is a test",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system",
"existAlarm" : false,
"instanceEnName" : "instance1",
"instanceDisplayName" : "instance1"
} ]
- 400: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Add Template Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute
Request Body
{
"comment" : "this is a test",
"dataType" : "LONG", //required
"subDataType" : "LONG", //required when dataType is set to SYSTEMCODE
"dataTypePrecision" : 0, //required when dataType is set to DECIMAL. leave it null for other types
"dataTypeScale" : 0, //required when dataType is set to DECIMAL
"defaultValue" : "666",
"display" : false, //whether is main display field
"displayName" : "p1", //required
"enName" : "p1", //required
"hasKeyRelation" : false, //whether primary or foreign key relations exist
"historical" : false, //required. whether to save history data. Leave it empty for DECIMAL, FILE and OBJECT data types
"persistent" : false, //required
"readWriteMode" : "READ_ONLY", //required
"stringMaxLength" : 0, //required when dataType is set to string
"unique" : false,
"valueScale" : 2, //required when dataType is set to FLOAT/DOUBLE/DECIMAL
"appAccessMode" : "PUBLIC", //required
"appName" : "system", //required
"appShowName" : "system",
"namespace" : "system",
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"unit" : "kg",
"compress" : true, //whether to set compress parameter
"paramValue" : "0.2", //set when setting compress to true
"paramUnit" : "%", //set when setting compress to true
"maxRisingPeriod" : 600, //set when setting compress to true
"labelIds" : [ 12333 ]
}
Response
- 200: Successful.
{
"code" : 200,
"data" : 19999,
"detail" : "string",
"message" : "ok"
}
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Get Created Attributes of Current Template
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/self
Query Parameter
Parameter | Type | Description |
---|---|---|
templateNamespace | string | - |
templateName | string | - |
pageIndex | integer | Required. Page number. The default is 1. |
pageSize | integer | Required. The number of data on each page. The default is 20 and the maximum is 500. |
Response
- 200: Successful.
{
"code" : 200,
"data" : {
"data" : [ {
"comment" : "this is a test template",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system"
} ],
"pageIndex" : 1,
"pageSize" : 20,
"total" : 100,
},
"detail" : "string",
"message" : "ok"
} - 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Edit Template Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/{attributeNamespace}/{attributeName}
Request body
{
"appAccessMode" : "PUBLIC", //PUBLIC or PRIVATE
"comment" : "edit attribute",
"compress" : false,
"defaultValue" : "12",
"display" : false,
"displayName" : "udpateAttribute1",
"historical" : false,
"id" : 16668,
"labelIds" : [ 15555 ],
"max" : 100,
"maxRisingPeriod" : 900,
"min" : 1,
"maxValue" : 100.88,
"minValue" : 0.88,
"paramUnit" : "%",
"paramValue" : "0.2",
"persistent" : false,
"readWriteMode" : "READ_ONLY", //READ_ONLY or READ_WRITE
"unique" : false,
"unit" : "kg",
"useDisplayField" : false, //whether to enable main display field
"valueScale" : 2
}
Response
- 200: Successful.
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Delete Template Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/attribute/{attributeNamespace}/{attributeName}
Response
- 200: Successful.
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Add Entity Instance Extension Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute
Request Body
{
"comment" : "this is a test template",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"appAccessMode" : "PUBLIC",
"appName" : "system",
"appShowName" : "system",
"namespace" : "system",
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"unit" : "kg",
"compress" : true,
"paramValue" : "0.2", //compress parameter value
"paramUnit" : "%", //compress parameter unit
"maxRisingPeriod" : 600, //compress parameter maximum rising period
"labelIds" : [ 12333 ]
}
Response
- 200: Successful.
{
"code" : 200,
"data" : 19999,
"detail" : "string",
"message" : "ok"
} - 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Edit Entity Instance Extension Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute/{attributeNamespace}/{attributeName}
Request Body
{
"appAccessMode" : "PUBLIC",
"comment" : "edit attribute",
"compress" : false,
"defaultValue" : "12",
"display" : false,
"displayName" : "udpateAttribute1",
"historical" : false,
"id" : 16668,
"labelIds" : [ 15555 ],
"max" : 100,
"maxRisingPeriod" : 900,
"min" : 1,
"maxValue" : 100.88,
"minValue" : 0.88,
"paramUnit" : "%",
"paramValue" : "0.2",
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"unique" : false,
"unit" : "kg",
"useDisplayField" : false,
"valueScale" : 2
}
Response
- 200: Successful.
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Delete Entity Instance Extension Attribute
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/entity/{instanceName}/attribute/{attributeNamespace}/{attributeName}
Response
- 200: Successful.
- 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}
Get Attribute of Current Instance
Path
http://{supOS ip:port}/open-api/supos/oodm/v2/template/{templateNamespace}/{templateName}/instance/{instanceName}/attribute/self
Response
- 200: Successful.
{
"code" : 200,
"data" : {
"data" : [ {
"comment" : "this is a test template",
"dataType" : "LONG",
"subDataType" : "LONG",
"dataTypePrecision" : 0,
"dataTypeScale" : 0,
"defaultValue" : "666",
"display" : false,
"displayName" : "p1",
"enName" : "p1",
"hasKeyRelation" : false,
"historical" : false,
"persistent" : false,
"readWriteMode" : "READ_ONLY",
"stringMaxLength" : 0,
"unique" : false,
"valueScale" : 2,
"id" : 12345,
"templateId" : 12222,
"sourceFunctionSetId" : 12221,
"instanceId" : "12223",
"labelIds" : [ 11111 ],
"deletable" : true,
"editable" : true,
"max" : 100,
"min" : 0,
"maxValue" : 100.88,
"minValue" : 0.88,
"namespace" : "system",
"unit" : "kg",
"templateName" : "Template_12",
"templateNamespace" : "system",
"existAlarm" : false,
"value" : "string",
"instanceEnName" : "string",
"instanceDisplayName" : "string"
} ],
"pageIndex" : 1,
"pageSize" : 20,
"total" : 100
},
"detail" : "string",
"message" : "ok"
} - 500: General internal error of OODM.
{
"code": 10001001,
"data": {},
"detail": "string",
"message": "string"
}